package com.func.infrastructure.persistent.dao.activity;

import cn.bugstack.middleware.db.router.annotation.DBRouter;
import com.func.infrastructure.persistent.po.activity.RaffleActivityAccountMonth;
import org.apache.ibatis.annotations.Mapper;

/**
 * <p>
 * IRaffleACtivityAccountMonthDap
 * </p>
 *
 * @author Simon
 * @version 2025.03.14.1.0.0
 * @description
 * @since 2025-03-14
 */

@Mapper
public interface IRaffleActivityAccountMonthDao {
    /**
     * 查询用户账户月余额实体
     * @param activityAccountMonthReq activityId, userId, month
     * @return 用户月账户实体
     */
    @DBRouter
    RaffleActivityAccountMonth queryActivityAccountMonthByUserId(RaffleActivityAccountMonth activityAccountMonthReq);

    /**
     * 将月账户余额--
     * @param raffleActivityAccountMonth 抽奖活动月账户
     * @return 影响的行数
     */
    int updateActivityAccountMonthSubtractionQuota(RaffleActivityAccountMonth raffleActivityAccountMonth);

    /**
     * 创建月余额账户
     * @param raffleActivityAccountMonth 活动月余额持久化对象
     */
    void insertActivityAccountMonth(RaffleActivityAccountMonth raffleActivityAccountMonth);

    void addAccountQuota(RaffleActivityAccountMonth raffleActivityAccountMonth);
}
